Skip to content

Conversation

@jayantk
Copy link
Contributor

@jayantk jayantk commented Jan 13, 2025

Two simple changes here

  • add a padding multiplier for the gas limit so that the keeper is willing to submit txs that slightly exceed the limit. I noticed a few failing txs in mainnet that are at ~510k gas, which could happen due to differences in the number of hashes. This defaults to 10% and that number should probably be fine without configuration.
  • support negative target profit percentages. It turns out that for abstract-testnet, you get a gas refund at the end of the tx which is like 50% of the tx cost. However, you need to set the priority fee without counting this refund. Given that, we're systematically overestimating the needed fee.

@vercel
Copy link

vercel bot commented Jan 13, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
api-reference ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 14, 2025 3:43am
proposals ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 14, 2025 3:43am
staking ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 14, 2025 3:43am
2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
component-library ⬜️ Ignored (Inspect) Visit Preview Jan 14, 2025 3:43am
insights ⬜️ Ignored (Inspect) Visit Preview Jan 14, 2025 3:43am

/// Must be larger than min_profit_pct.
pub max_profit_pct: u64,
/// The minimum value for this is -100. If set to < 0, it means the keeper may lose money on callbacks that use the full gas limit.
pub max_profit_pct: i64,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(In hindsight, I wish that i had specified these values as multipliers, so 0 would be the natural lower bound and you could just say "75" instead of "-25". That's how I did the other scalars and it would have been better here.

However, I'm choosing to support up to -100 now in order to maintain backward compatibility on the config format)

chain_eth_config.target_profit_pct,
chain_eth_config.max_profit_pct,
// NOTE: unwrap() here so we panic early if someone configures these values below -100.
u64::try_from(100 + chain_eth_config.min_profit_pct).unwrap(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe just switch to expect to give more context

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants